﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace CommonLib {
    public class Char2Hex {
        static public string Convert(char c) {
            if (!Regex.IsMatch(c.ToString(), @"[A-Za-z\d_\.\:\-\/]")) {
                return "%" + String.Format("{0:X}", System.Convert.ToUInt32(c));
            } else {
                return c.ToString();
            }

        }
    }
}
